package model;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * Cohort of Moodle site.
 * 
 * @author Sergey Nikonenko
 */
public class MoodleCohort {
    
    private long id;
    private String name;
    private String idnumber;
    private String description;
    private long descriptionformat;
    private List<CohortContext> categorytype = new ArrayList<CohortContext>();

    public MoodleCohort() {
    }

    public MoodleCohort(long id, String name, String idnumber, String description, long descriptionformat) {
        this.id = id;
        this.name = name;
        this.idnumber = idnumber;
        this.description = description;
        this.descriptionformat = descriptionformat;
    }
    /**
     * ID of the cohort.
     * 
     * @return the id
     */
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }
     /**
     * Cohort name.
     * 
     * @return the name
     */
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
     /**
     * Cohort idnumber.
     * 
     * @return the idnumber
     */
    public String getIdnumber() {
        return idnumber;
    }

    public void setIdnumber(String idnumber) {
        this.idnumber = idnumber;
    }
     /**
     * Cohort description.
     * 
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
      /**
     * Description format (1 = HTML, 0 = MOODLE, 2 = PLAIN or 4 = MARKDOWN).
     * 
     * @return the descriptionformat
     */
    public long getDescriptionformat() {
        return descriptionformat;
    }

    public void setDescriptionformat(long descriptionformat) {
        this.descriptionformat = descriptionformat;
    }
  
    public List<CohortContext> getCategorytype() {
        return categorytype;
    }

    public void setCategorytype(List<CohortContext> categorytype) {
        this.categorytype = categorytype;
    }

    @Override
    public String toString() {
        return "MoodleCohort{" + "id=" + id + ", name=" + name + ", idnumber=" + idnumber + ", description=" + description + ", descriptionformat=" + descriptionformat + ", categorytype=" + categorytype + '}';
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 59 * hash + Objects.hashCode(this.name);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final MoodleCohort other = (MoodleCohort) obj;
        if (!Objects.equals(this.name, other.name)) {
            return false;
        }
        return true;
    }

    

    
}
